<template>
  <div>
    <div class="modal">
      <div class="modal-bg" @click="HfollwClose"></div>
      <div class="Htran">
        <div class="rele-titles">
          跟进房源
          <div class="right-images">
            <div>
                <img @click="HfollwClose"src="../assets/img/tub.png" alt="">
            </div>

            </div>
        </div>
        <div class="li-p">
          <div class="Htran-li">
            <div class="Htran-b-li">
              <div class="Htran-b-name">
                跟进方式
              </div>
              <div class="Htran-b-input">
                <select v-model="FollowValue" placeholder="请选择" style="width: 250%;height: 28px;">
                  <option
                    v-for="item in Follow"
                    :key="item.id"
                    :label="item.title"
                    :value="item.id">
                  </option>
                </select>
              </div>
            </div>

            <div class="Htran-b-li">
              <div class="Htran-b-name">
                跟进内容
              </div>
              <div class="Htran-b-input">
                <el-input
                  type="textarea"
                  :rows="6"
                  placeholder="请输入内容"
                  v-model="textarea" style="width:250%;border: 1px solid #a0a0a0; cursor:pointer;!important;">
                </el-input>
              </div>
            </div>
          </div>
          <div class="btn">
            <el-button @click="submi" type="primary" style="margin-left: 30%;position: absolute;" >保存</el-button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script type="text/babel">
  export default {
    props:{
      LDmodal:{
        type:Function
      },
      HfollwClose:{
        type:Function
      },
      ids:{
        type:Number
      }
    },
    data () {
      return {
        timevalue2:"",
        timevalue1:"",
        HtranClose:"",
        textarea:"",
        FollowValue:"",
        Follow: [{
          FollowValue: '选项1',
          label: '黄金糕'
        },
        ]
      }
    },
    computed:{
      SSid(){
        return this.ids
      }
    },
    methods: {
      submi(){
        let that = this;
        this.$http.post('/index/house_up',{house_id:that.SSid,mode_id:that.FollowValue,content:that.textarea})
          .then(function(res) {
            // console.log(res);
            if (res.data.status === 1) {
              that.HfollwClose();
              // that.SSid = '';
              that.FollowValue = '';
              that.textarea = '';
              that.$store.state.messageString = res.data.msg;
              that.LDmodal();
            }else {
              that.$store.state.messageString = res.data.msg;
              that.LDmodal();
            }
          })
          .catch(function(err) { console.log(err);
          })
      }
    },
    mounted:function(){
      // 跟进方式列表
      let that = this;
      this.$http.get('/index/house_up/mode')
        .then(function(res) {
          that.Follow=res.data
        })
        .catch(function(err) { console.log(err);
        })
    }
  }
</script>
<style scoped>

  .btn{
    margin-top: 30px;
    width: 90%;
    padding: 0 5%;
    float: left;
  }
  .btn button{
    width: 100px;
    color: #fff;
    height:35px;
    border:none;
    border-radius: 5px;
  }
  .btn button:nth-child(2){
    float: right;
  }
  .Htran-b-name{
    width: 35%;
    text-align: center;
    float: left;
    line-height: 27px;
  }
  .Htran-b-input{
    width: 65%;
    float: left;
  }
  .Htran-b-input input{
    width: 100%;
    line-height: 27px;
    box-sizing: border-box;
  }
  .li-p{
    width: 94%;
    float: left;
    padding: 0 3%;
  }
  .Htran-b-li{
    margin-top: 10px;
    width: 100%;
    float: left;
  }
  .Htran-li{
    margin-top: 15px;
    width: 50%;
    float: left;
  }
  .Htran-input input{
    width: 100%;
    float: left;
    border:none;
    line-height: 27px;
    border-bottom: 1px solid  #d3d3d3;
  }
  .Htran{
    width:350px;
    height: 340px;
    border-radius: 5px;
    overflow: hidden;
    background: #fff;
    position:absolute;
    top: 50%;
    margin-top: -180px;
    left:50%;
    margin-left:-175px;
    z-index: 10;
    box-shadow: #e8e7e7 0px 0px 10px;
  }

  .rele-titles {
    width:100%;
    padding: 0 3%;
    line-height: 50px;
    font-size: 2em;
    color: #000;
    background: #f5f5f7;
    z-index: 9;
    border-bottom: 1px solid #d3d3d3;
    position: relative;

  }
  .rele-titles img{
    right: 20px;
    position: relative;
  }
  .right-images{
    position: absolute;
    right:0;
    top:0;
    width:30px;
    height:50px;
    cursor:pointer;
  }
  .right-images div img{
      vertical-align:middle;
      cursor: pointer;
  }
select{
  cursor:pointer;
}
</style>
